import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AppComponent } from './app.component';


const routes: Routes = [
  {
    path: '', component: AppComponent,
    children: [
      {
        // 默认路由
        path: '', redirectTo: 'gzh-menu', pathMatch: 'full'
      },
      {
        // 商城，个人中心，购物车
        path: 'tabbar', loadChildren: () => import('./routes/tabbar/tabbar.module').then(m => m.TabbarModule)
      },
      {
        // 绑定手机号
        // tslint:disable-next-line: max-line-length
        path: 'bindPhoneNumber', loadChildren: () => import('./routes/bind-phone-number/bind-phone-number.module').then(m => m.BindPhoneNumberModule)
      },
      {
        // 公众号界面
        path: 'gzh-menu', loadChildren: () => import('./routes/gzh-menu/gzh-menu.module').then(m => m.GzhMenuModule)
      }
    ]
  }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
